<%@page language="java" pageEncoding="UTF-8"%>
<%@taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt"%>
<HTML>
	<HEAD>
		<TITLE>添加通讯录</TITLE>
		<LINK href="<%=request.getContextPath()%>/jsp/manage/css/style.css" type=text/css rel=stylesheet>
	</HEAD>
	<script type="text/javascript">
	function CheckForm(){
		var str;
		str=document.myform.name.value.replace(/\s+/g, '');
		if (str==''){
		   alert('姓名不能为空！');
		   document.myform.name.focus();
		   return false;
		}
		str=document.myform.email.value.replace(/\s+/g, '');
		if (str==''){
		   alert('EMail不能为空！');
		   document.myform.email.focus();
		   return false;
		}else{
		    if(document.myform.email.value.indexOf("@")==-1||document.myform.email.value.indexOf(".")==-1)
		    {
		       window.alert("请输入正确的E-mail地址！")
		       document.myform.email.focus();
		       return false;
		    }
		 }
		return true;  
	}
	</script>
	<BODY topMargin="0" marginheight="0" marginwidth="0">

		<FORM name="myform" onsubmit="return CheckForm();" method="post" target="_self" 
			action="<%=request.getContextPath()%>/libAddrManage.do?method=libaddrsave">
			<TABLE class="border" cellSpacing="0" cellPadding="0" width="100%" align="center" border="0">
				<TBODY>
					<TR class="topbg">
						<TD height=22 colSpan=2 align=middle>
							<STRONG><bean:message key="libaddrlist.libaddradd.addlinkman" /> </STRONG>
						</TD>
					</TR>
					<TR align=middle>
						<TD>
							<TABLE cellSpacing=1 cellPadding=2 width="100%" border=0>
								<TBODY>
									<TR class=tdbg>
										<TD align=right width=120>
											&nbsp;
										</TD>
										<TD width="654">
											<FONT color=#ff0000>
												<STRONG>注意<font color="#0000ff">*的内容必须填</font> </STRONG> 
											</FONT>
										</TD>
									</TR>
									<TR class=tdbg>
										<TD align=right width=120>
											<STRONG>姓名：</STRONG>
										</TD>
										<TD colSpan=2>
											<input id='name' maxlength=255 size=50 name='name'>
											<FONT color=#ff0000>*</FONT>
										</TD>
									</TR>
									<TR class=tdbg>
										<TD align=right width=120>
											<STRONG>职位：</STRONG>
										</TD>
										<TD colSpan=2>
											<input id=position maxlength=255 size=50 name='position'>
										</TD>
									</TR>
									<TR class=tdbg>
										<TD align=right width=120>
											<STRONG>电话：</STRONG>
										</TD>
										<TD colSpan=2>
											<input id=tel maxlength=255 size=50 name=tel>
										</TD>
									</TR>
									<TR class=tdbg>
										<TD align=right width=120>
											<STRONG>E-Mail：</STRONG>
										</TD>
										<TD colSpan=2>
											<input id='email' maxlength=255 size=50 name='email'>
											<FONT color=#ff0000>*</FONT>
										</TD>
									</TR>
									<TR class=tdbg>
										<TD align=right width=120>
											<STRONG>校区：</STRONG>
										</TD>
										<TD colSpan=2>
											<select name="area">
												<option value="东校区">
													<bean:message key="libaddrlist.eastarea" />
												</option>
												<option value="西校区">
													<bean:message key="libaddrlist.westarea" />
												</option>
											</select>
										</TD>
									</TR>
									<TR class=tdbg id=ArticleContent>
										<TD align=right width=120>
											<STRONG>部门：</STRONG>
										</TD>
										<TD colSpan=2>
											<select name="department">
												<logic:iterate id="w" name="departnamelist"
													indexId="count">
													<option value="${w[0]}">
														${w[1]}
													</option>
												</logic:iterate>
											</select>

										</TD>
									</TR>
									<TR class=tdbg>
										<TD align=right width=120>
											<STRONG>备注：</STRONG>
										</TD>
										<TD colSpan=2>
											<textarea cols="100" rows="20" name="memo" style="left: auto"></textarea>
										</TD>
									</TR>
								</TBODY>
							</TABLE>
						</TD>
					</TR>
					<tr align="center">
						<td colspan="2">
							<INPUT id="Save" style="CURSOR: hand" type="submit" value="添加" name="Save">
							<INPUT id="Cancel" style="CURSOR: hand" type="reset" value="取消" name="Cancel" 
								onclick="window.location.reload('<%=request.getContextPath()%>/libAddrManage.do?method=libaddrlist') " >
						</td>
					</tr>
				</TBODY>
			</TABLE>
			<BR>
		</FORM>
	</BODY>
</HTML>
